package com.heima.behavior.mapper;


import com.heima.model.article.pojos.ApArticle;
import com.heima.model.behavior.dtos.ApArticleCountDto;
import com.heima.model.behavior.dtos.LikesBehaviorDto;
import com.heima.model.behavior.pojos.ApArticleCount;
import com.heima.model.behavior.pojos.ApArticleLike;
import com.heima.model.behavior.pojos.ApArticleUnlike;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface ApBehaviorMapper {
    /**
     * 点赞行为
     * @param
     */
    void likeBehavior(Long articleId);

    /**
     * 添加点赞记录
     * @param articleLike
     */
    void insertArticleLike(ApArticleLike articleLike);

    /**
     * 查询点赞记录
     * @param
     * @return
     */
    ApArticleLike findLikeByArticleId(Long articleId);

    /**
     * 查询文章信息
     * @param articleId
     * @return
     */
    ApArticle findArticle(Long articleId);

    /**
     * 取消点赞
     * @param articleId
     */
    void updateCancelLike(Long articleId);

    /**
     * 阅读次数
     * @param
     */
    void updateReadBehaviorCounts(String articleId, Integer count);

    /**
     * 添加不喜欢
     * @param
     */
    void addUnlikesBehavior(Long userId, String articleId, Short type);

    /**
     * 更新不喜欢
     * @param articleId
     * @param type
     */
    void updateUnlikeBehavior(String articleId, Short type);

    /**
     * 查询不喜欢
     * @param articleId
     * @return
     */
    ApArticleUnlike findUnLikeByArticleId(Long articleId);

    /**
     * 获取阅读表信息
     * @param articleId
     * @return
     */
    ApArticleCount findReadCounts(String articleId);

    /**
     * 添加阅读表信息
     * @param
     */
    void insertArticleCounts(String articleId, Integer count);

}
